import java.sql.*;
public class MiddleEast {
	public static void main(String args[]) {
		int sum = 0,p;
		Connection con;
		Statement sql;
		ResultSet rs;
		con = GetDBConnection.connectDB("world", "root", "");
		if (con == null) return;
		String sqlStr = "select *from country where Region='Middle East'";
		try{
			sql = con.createStatement();
			rs = sql.executeQuery(sqlStr);
			while(rs.next()){
				p = rs.getInt(7);
				sum = sum+p;
			}
			System.out.println(sum);
			con.close();
		}
		catch(SQLException e){
			System.out.println(e);
		}
	}
}

